package cn.xq.pethome.utils;

import lombok.Data;

import javax.swing.table.TableRowSorter;

@Data
public class AjaxUtil {
    private String msg;
    private Boolean success;
    private  Object data;
    private Long total;

    public AjaxUtil(String msg, Boolean success) {
        this.msg = msg;
        this.success = success;
    }

    public static AjaxUtil success(){
        return new AjaxUtil("成功",true);
    }
    public static AjaxUtil error(){
        return  new AjaxUtil("失败",false);
    }
    public AjaxUtil setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public AjaxUtil setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxUtil setData(Object data) {
        this.data = data;
        return this;
    }

    public AjaxUtil setTotal(Long total) {
        this.total = total;
        return this;
    }
}
